{template header}

    {template sidebar}

    <div class="article">
        {template title}

    <!--{if $a == 'index'}-->
        <table>
            <tr>
                <th>部门名称</th>
                <th width="15%">后台管理</th>
                <th width="25%">操作</th>
            </tr>
        <!--{if $this->group}-->
            <!--{loop $this->group $v}-->
            <tr>
                <td>{$v['title']}</td>
                <td>{$v['admin'] ? '√' : 'x'}</td>
                <td class="operate">
                    <a href="{$this->url($c,'purview',array('id'=>$v['id']))}">权限</a>
                    <a href="{$this->url($c,'edit',array('id'=>$v['id']))}">编辑</a>
                    <!--{if !$v['system']}-->
                    <a class="del" href="{$this->url($c,'del',array('id'=>$v['id']))}">删除</a>
                    <!--{/if}-->
                </td>
            </tr>
            <!--{/loop}-->
        <!--{else}-->
            <tr>
                <td colspan="5">没有{$this->name}!</td>
            </tr>
        <!--{/if}-->
            <tr>
                <td colspan="5" class="td6 over">
                    <a class="btn btn-success" href="{$this->url($c, 'add')}">添加{$this->name}</a>
                </td>
            </tr>
        </table>
    <!--{/if}-->
    <!--{if $a == 'edit' || $a == 'add'}-->
        <form method="post" action="{$this->url($c, 'save', array('id' => $result['id']) )}">
            <table>
                <tr>
                    <td class="td1" width="25%">部门名称：</td>
                    <td class="td2">
                        <input type="text" name="title" value="{$result['title']}" placeholder="请输入部门名称" class="required" />
                    </td>
                </tr>
                <!--{if $a == 'add'}-->
                <tr>
                    <td class="td1">所在部门：</td>
                    <td class="td2">
                        <select name="system">
                            <!--{loop $this->group $v}-->
                            <!--{if $v['id'] > 1}-->
                            <option value="{$v['system']}">{$v['title']}</option>
                            <!--{/if}-->
                            <!--{/loop}-->
                        </select>
                    </td>
                </tr>
                <!--{/if}-->
                <tr>
                    <th colspan="2" class="td4">
                        <a class="btn btn-success save" href="{$this->url($c)}">保存</a>
                    </th>
                </tr>
            </table>
        </form>
    <!--{/if}-->
    <!--{if $a == 'purview'}-->
    <!--{/if}-->
    </div>
    <!-- artile end -->
{template footer}